JavaScript

A5.ListBoxpopulate Method

Syntax

A5.ListBox.populate(data[,keepValue[,animation[,fireEvent]])

Arguments

dataobject

Data for the list.

keepValueboolean

Whether or not to keep the previous value of the list or reset it.

animationbooleanstringobject

What animation to perform. To not animate pass in false. If a string is passed in the value can be either "next" or "prev". If an object is passed in then the object must contain "type" which can be "next" or "prev" and "duration" for custom duration of the animation. This will swap the data displayed with a slide animation based on the specified flow (in A5.ListBox.animation.swap.flow).

fireEventboolean

Whether or not to fire the populate events.

Description

Populate the list with new data.

Example

// To get a pointer to the A5.ListBox class see {dialog.object}.getControl
// assume lObj is a pointer to an instance of the A5.ListBox class
var data = [{name: 'Fred Smith', age: 23}];
lObj.populate(data); // now the list has a single row of data

Example: Populating a List Control in a UX Component

The following JavaScript demonstrates populating a List Control in a UX Component.

var listObj = {dialog.object}.getControl('LIST1');
var _d = [
        {firstname: 'John', lastname: 'Smith'},
        {firstname: 'Fred', lastname: 'Harris'}
    ];
listObj.populate(_d);

See Also